package com.ustze.ocr.ocrtype.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

@Getter
@AllArgsConstructor
public enum OcrType {



    ALI(1, "阿里"),
    BAIDU(2, "百度"),
    TENCENT(3, "腾讯"),

    ;


    private final Integer code;

    private final String desc;

    public static OcrType ofCode(Integer code) {
        return Stream.of(values()).filter(type -> type.code.equals(code)).findFirst().orElse(null);
    }


}
